package com.lora.common;

public class GenerateExcelHeadDto {

	private int[][] strategy;

	private int row = 0;

	private int col = 0;

	public GenerateExcelHeadDto(int row, int col) {
		this.row = row;
		this.col = col;
		strategy = new int[row][col];
		for(int i = 0; i < row; i++) {
			for(int j = 0; j < col; j++) {
				strategy[i][j] = 0;
			}
		}
	}

	public void usePosition(int row, int col) {
		if(this.row > row && this.col > col) {
			strategy[row][col] = 1;
		}
	}

	public int getAvailblePositionCellByRow(int row) {
		int position = 0;
		for(int i = 0; i < strategy[row].length; i++) {
			if(strategy[row][i] == 0) {
				position = i;
				break;
			}
		}
		return position;
	}

	public int getAvailblePositionCellByRow(int row, int gteCol) {
		int position = 0;
		for(int i = 0; i < strategy[row].length; i++) {
			if(strategy[row][i] == 0 && i >= gteCol) {
				position = i;
				break;
			}
		}
		return position;
	}

}
